<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
   
        // let a = function() {
        //     console.log(this);
        // }
        // console.log(a === window.a);
        // a();  //函数名() 执行，this指向window
        // a.call(2);


        // let a = {
        //     name: '123',
        //     x: function() {
        //         console.log(this);
        //     }
        // };
        // a.x();  // 对象方法自执行，this指向对象


        let zhuque = {
            name: 'zhuque-name',
            xx: {
                name: "xx-name",
                a: function() {
                    console.log(this);
                }
            }
        };
        zhuque.xx.a()

    </script>
</body>
</html>